package com.study.student_chuji.demos.controller;

import com.study.student_chuji.demos.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class ProductController {

    @Autowired
    private ProductService productService;

    @GetMapping("/getProductList")
    public String getProductList(Model model){
        //TODO
        model.addAttribute("products" ,productService.getProductList());
        return "productList";
    }
}
